package com.hc.config;

import com.hc.interceptor.IndexInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 舞遍邓城一条街
 * @description 设置拦截路径，放行静态资源
 *              配置类添加拦截器不知道为啥不生效，转到配置文件配置拦截器
 * @Date 2021/11/24 15:22
 */
//@Configuration
//@EnableWebMvc
public class LoginConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new IndexInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/","/adminex/**","/lyear/**","/uploadimg/**");
    }
}
